load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ctxutil",
    srcs = [
        "canceler_1_20.go",
        "canceler_1_21_bazel.go",
        "context.go",
        "doc.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/util/ctxutil",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/buildutil",
        "//pkg/util/log",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "ctxutil_test",
    srcs = ["context_test.go"],
    embed = [":ctxutil"],
    deps = [
        "//pkg/util/leaktest",
        "@com_github_stretchr_testify//require",
    ],
)
